﻿function ResolveToLink(pageID, siteurl){
    var url;
    var xhr;
   
    xhr = new XMLHttpRequest(); 
    xhr.onreadystatechange =  function(){
   
      if (xhr.readyState==4 || xhr.readyState=="complete") {   
        url = xhr.responseText;        
      }
    };
  
    xhr.open("GET",siteurl+"Templates/TinyMCE/tmp.aspx?pageID="+pageID, false);
    xhr.send(null);
    return url;
}